package com.bw1806.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.bw1806.mapper.TUserMapper;
import com.bw1806.pojo.TUser;
import com.bw1806.pojo.TUserExample;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @描述
 * @创建人 wangyue
 * @创建时间2020/11/2015:07
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private TUserMapper tUserMapper;

    @Override
    public TUser getByUserName(String username) {

        TUserExample example= new TUserExample();
        TUserExample.Criteria criteria = example.createCriteria();
        criteria.andUsernameEqualTo(username);
        List<TUser> tUsers = tUserMapper.selectByExample(example);
        return tUsers.get(0);
    }
}
